import React from 'react';
import { Layout, Button, Menu } from 'antd';
import {NavLink} from 'react-router-dom'
const { Sider } = Layout;
const { SubMenu } = Menu
class Nav extends React.Component {
  state = {
    collapsed: false,
    selectedKeys:['userlist']
  };

  render() {
    return <Sider className='' style={{ width: 256 }}>
      <Menu
        defaultSelectedKeys={['userlist']}
        defaultOpenKeys={['sub1']}
        mode="inline"
        theme="dark"
        
      >
        <SubMenu key="sub1" title="员工管理">
          {/* <NavLink to='/userList'><Menu.Item key="1">员工列表</Menu.Item></NavLink>
          <NavLink to='/adduser'><Menu.Item key="1">新增员工</Menu.Item></NavLink>
          ---------------------------------- */}
          <Menu.Item key="userlist">
          {/* 这种写法 需要借助 selectedKeys + redux*/}
            <NavLink to='/org/userlist'>客户列表</NavLink>
          </Menu.Item>
          <Menu.Item key="adduser">
            <NavLink to='/org/adduser'>新增客户</NavLink>
          </Menu.Item>
        </SubMenu>
      </Menu>
    </Sider>;
  }
}
export default Nav